<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
    <title>ИС "Аттестация рабочих мест"</title>
    <link rel="stylesheet" type="text/css" href="/arm/resources/css/style.css">
</head>
<body>


<f:view>
    <a4j:form id="frm" ajaxSubmit="true">

        <%@ include file="/pages/common/menu.jsp" %>

        <h:panelGrid columns="3">

            <h:outputText id="orgNumberLbl" value="Номер договора"/>
            <h:inputText id="orgNumberTxt" value="#{contractBean.contract.num}" maxlength="8"/>
            <rich:message for="orgNumberTxt" styleClass="error" />

            <h:outputText id="orgYearLbl" value="Год договора"/>
            <h:inputText id="orgYearTxt" required="true" value="#{contractBean.contract.year}" maxlength="4">
                <f:validateLongRange minimum="2010" maximum="2050"/>
            </h:inputText>
            <rich:message for="orgYearTxt" styleClass="error" />

            <h:outputText id="orgOrgLbl" value="Наименование организации"/>
            <h:selectOneMenu id="orgs" value="#{contractBean.contract.dicOrganization}"  required="true"
                             converter="identifableConverter">
                <f:selectItems value="#{contractBean.orgList}"/>
            </h:selectOneMenu>
            <rich:message for="orgs" styleClass="error" />
        </h:panelGrid>

        <h:panelGrid id="pnlButtonsRows" columns="2">
            <a4j:commandButton id="btnSave" action="#{contractBean.save}" value="Сохранить"/>
            <a4j:commandButton id="btnCancel" action="#{contractBean.cancel}" immediate="true" value="Отмена"/>
        </h:panelGrid>
    </a4j:form>
</f:view>
</body>
</html>